<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LINE 2 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LINE 6 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  System.Win32.Info</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) Alastair Reid, 1997-2003</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  Esa Ilari Vuokko &lt;ei@vuokko.info&gt;</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- A collection of FFI declarations for interfacing with Win32.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Win32.Info</span><span>
</span><span id="line-21"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_SCROLLBAR</span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_BACKGROUND</span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_ACTIVECAPTION</span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_INACTIVECAPTION</span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_MENU</span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_WINDOW</span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_WINDOWFRAME</span><span>
</span><span id="line-29"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_MENUTEXT</span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_WINDOWTEXT</span><span>
</span><span id="line-31"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_CAPTIONTEXT</span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_ACTIVEBORDER</span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_INACTIVEBORDER</span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_APPWORKSPACE</span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_HIGHLIGHT</span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_HIGHLIGHTTEXT</span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_BTNFACE</span><span>
</span><span id="line-38"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_BTNSHADOW</span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_GRAYTEXT</span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_BTNTEXT</span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_INACTIVECAPTIONTEXT</span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">cOLOR_BTNHIGHLIGHT</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span>      </span><span class="hs-comment">-- * Standard directories</span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getSystemDirectory</span><span>
</span><span id="line-46"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getWindowsDirectory</span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getCurrentDirectory</span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getTemporaryDirectory</span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getFullPathName</span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getLongPathName</span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getShortPathName</span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">searchPath</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span>      </span><span class="hs-comment">-- * System information</span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ProcessorArchitecture</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">SYSTEM_INFO</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getSystemInfo</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>      </span><span class="hs-comment">-- * System metrics</span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-61"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_ARRANGE</span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CLEANBOOT</span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CMETRICS</span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CMOUSEBUTTONS</span><span>
</span><span id="line-65"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXBORDER</span><span>
</span><span id="line-66"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYBORDER</span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXCURSOR</span><span>
</span><span id="line-68"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYCURSOR</span><span>
</span><span id="line-69"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXDLGFRAME</span><span>
</span><span id="line-70"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYDLGFRAME</span><span>
</span><span id="line-71"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXDOUBLECLK</span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYDOUBLECLK</span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXDRAG</span><span>
</span><span id="line-74"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYDRAG</span><span>
</span><span id="line-75"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXEDGE</span><span>
</span><span id="line-76"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYEDGE</span><span>
</span><span id="line-77"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXFRAME</span><span>
</span><span id="line-78"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYFRAME</span><span>
</span><span id="line-79"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXFULLSCREEN</span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYFULLSCREEN</span><span>
</span><span id="line-81"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXHSCROLL</span><span>
</span><span id="line-82"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYVSCROLL</span><span>
</span><span id="line-83"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXICON</span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYICON</span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXICONSPACING</span><span>
</span><span id="line-86"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYICONSPACING</span><span>
</span><span id="line-87"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXMAXIMIZED</span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYMAXIMIZED</span><span>
</span><span id="line-89"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXMENUCHECK</span><span>
</span><span id="line-90"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYMENUCHECK</span><span>
</span><span id="line-91"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXMENUSIZE</span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYMENUSIZE</span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXMIN</span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYMIN</span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXMINIMIZED</span><span>
</span><span id="line-96"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYMINIMIZED</span><span>
</span><span id="line-97"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXMINTRACK</span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYMINTRACK</span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXSCREEN</span><span>
</span><span id="line-100"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYSCREEN</span><span>
</span><span id="line-101"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXSIZE</span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYSIZE</span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXSIZEFRAME</span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYSIZEFRAME</span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXSMICON</span><span>
</span><span id="line-106"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYSMICON</span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXSMSIZE</span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYSMSIZE</span><span>
</span><span id="line-109"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CXVSCROLL</span><span>
</span><span id="line-110"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYHSCROLL</span><span>
</span><span id="line-111"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYVTHUMB</span><span>
</span><span id="line-112"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYCAPTION</span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYKANJIWINDOW</span><span>
</span><span id="line-114"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYMENU</span><span>
</span><span id="line-115"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_CYSMCAPTION</span><span>
</span><span id="line-116"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_DBCSENABLED</span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_DEBUG</span><span>
</span><span id="line-118"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_MENUDROPALIGNMENT</span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_MIDEASTENABLED</span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_MOUSEPRESENT</span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_NETWORK</span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_PENWINDOWS</span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_SECURE</span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_SHOWSOUNDS</span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_SLOWMACHINE</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sM_SWAPBUTTON</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span>      </span><span class="hs-comment">-- * User name</span><span>
</span><span id="line-129"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getUserName</span><span>
</span><span id="line-130"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control.Exception</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">catch</span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.Marshal.Alloc</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">alloca</span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.Marshal.Utils</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">with</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">maybeWith</span><span class="hs-special">)</span><span>
</span><span id="line-135"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.Marshal.Array</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">allocaArray</span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.Ptr</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Ptr</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">nullPtr</span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.Storable</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Storable</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-138"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.IO.Error</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isDoesNotExistError</span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Win32.Types</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">DWORD</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPDWORD</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPCTSTR</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPTSTR</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPVOID</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">UINT</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">WORD</span><span class="hs-special">)</span><span>
</span><span id="line-140"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Win32.Types</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">failIfFalse_</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">peekTStringLen</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">withTString</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">try</span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-pragma">{-# LINE 145 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span class="hs-cpp">

#include &quot;windows_cconv.h&quot;
</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- Environment Strings</span><span>
</span><span id="line-153"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-comment">-- %fun ExpandEnvironmentStrings :: String -&gt; IO String</span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-158"></span><span class="hs-comment">-- Computer Name</span><span>
</span><span id="line-159"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span class="hs-comment">-- %fun GetComputerName :: IO String</span><span>
</span><span id="line-162"></span><span class="hs-comment">-- %fun SetComputerName :: String -&gt; IO ()</span><span>
</span><span id="line-163"></span><span class="hs-comment">-- %end free(arg1)</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-166"></span><span class="hs-comment">-- Hardware Profiles</span><span>
</span><span id="line-167"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-168"></span><span>
</span><span id="line-169"></span><span class="hs-comment">-- %fun GetCurrentHwProfile :: IO HW_PROFILE_INFO</span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-172"></span><span class="hs-comment">-- Keyboard Type</span><span>
</span><span id="line-173"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="hs-comment">-- %fun GetKeyboardType :: KeyboardTypeKind -&gt; IO KeyboardType</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- System Color</span><span>
</span><span id="line-179"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">SystemColor</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-comment">-- ToDo: This list is out of date.</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-identifier">cOLOR_SCROLLBAR</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-186"></span><span class="hs-identifier">cOLOR_SCROLLBAR</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">0</span><span>
</span><span id="line-187"></span><span class="hs-identifier">cOLOR_BACKGROUND</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-188"></span><span class="hs-identifier">cOLOR_BACKGROUND</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1</span><span>
</span><span id="line-189"></span><span class="hs-identifier">cOLOR_ACTIVECAPTION</span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-190"></span><span class="hs-identifier">cOLOR_ACTIVECAPTION</span><span>   </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">2</span><span>
</span><span id="line-191"></span><span class="hs-identifier">cOLOR_INACTIVECAPTION</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-192"></span><span class="hs-identifier">cOLOR_INACTIVECAPTION</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">3</span><span>
</span><span id="line-193"></span><span class="hs-identifier">cOLOR_MENU</span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-194"></span><span class="hs-identifier">cOLOR_MENU</span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">4</span><span>
</span><span id="line-195"></span><span class="hs-identifier">cOLOR_WINDOW</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-196"></span><span class="hs-identifier">cOLOR_WINDOW</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">5</span><span>
</span><span id="line-197"></span><span class="hs-identifier">cOLOR_WINDOWFRAME</span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-198"></span><span class="hs-identifier">cOLOR_WINDOWFRAME</span><span>     </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">6</span><span>
</span><span id="line-199"></span><span class="hs-identifier">cOLOR_MENUTEXT</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-200"></span><span class="hs-identifier">cOLOR_MENUTEXT</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">7</span><span>
</span><span id="line-201"></span><span class="hs-identifier">cOLOR_WINDOWTEXT</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-202"></span><span class="hs-identifier">cOLOR_WINDOWTEXT</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">8</span><span>
</span><span id="line-203"></span><span class="hs-identifier">cOLOR_CAPTIONTEXT</span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-204"></span><span class="hs-identifier">cOLOR_CAPTIONTEXT</span><span>     </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">9</span><span>
</span><span id="line-205"></span><span class="hs-identifier">cOLOR_ACTIVEBORDER</span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-206"></span><span class="hs-identifier">cOLOR_ACTIVEBORDER</span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">10</span><span>
</span><span id="line-207"></span><span class="hs-identifier">cOLOR_INACTIVEBORDER</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-208"></span><span class="hs-identifier">cOLOR_INACTIVEBORDER</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">11</span><span>
</span><span id="line-209"></span><span class="hs-identifier">cOLOR_APPWORKSPACE</span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-210"></span><span class="hs-identifier">cOLOR_APPWORKSPACE</span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">12</span><span>
</span><span id="line-211"></span><span class="hs-identifier">cOLOR_HIGHLIGHT</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-212"></span><span class="hs-identifier">cOLOR_HIGHLIGHT</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">13</span><span>
</span><span id="line-213"></span><span class="hs-identifier">cOLOR_HIGHLIGHTTEXT</span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-214"></span><span class="hs-identifier">cOLOR_HIGHLIGHTTEXT</span><span>   </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">14</span><span>
</span><span id="line-215"></span><span class="hs-identifier">cOLOR_BTNFACE</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-216"></span><span class="hs-identifier">cOLOR_BTNFACE</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">15</span><span>
</span><span id="line-217"></span><span class="hs-identifier">cOLOR_BTNSHADOW</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-218"></span><span class="hs-identifier">cOLOR_BTNSHADOW</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">16</span><span>
</span><span id="line-219"></span><span class="hs-identifier">cOLOR_GRAYTEXT</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-220"></span><span class="hs-identifier">cOLOR_GRAYTEXT</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">17</span><span>
</span><span id="line-221"></span><span class="hs-identifier">cOLOR_BTNTEXT</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-222"></span><span class="hs-identifier">cOLOR_BTNTEXT</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">18</span><span>
</span><span id="line-223"></span><span class="hs-identifier">cOLOR_INACTIVECAPTIONTEXT</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-224"></span><span class="hs-identifier">cOLOR_INACTIVECAPTIONTEXT</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">19</span><span>
</span><span id="line-225"></span><span class="hs-identifier">cOLOR_BTNHIGHLIGHT</span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SystemColor</span><span>
</span><span id="line-226"></span><span class="hs-identifier">cOLOR_BTNHIGHLIGHT</span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">20</span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-pragma">{-# LINE 208 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="hs-comment">-- %fun GetSysColor :: SystemColor -&gt; IO COLORREF</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- %fun SetSysColors :: [(SystemColor,COLORREF)] -&gt; IO ()</span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- Standard Directories</span><span>
</span><span id="line-214"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span class="hs-identifier">getSystemDirectory</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-217"></span><span class="hs-identifier">getSystemDirectory</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;GetSystemDirectory&quot;</span><span> </span><span class="hs-identifier">c_getSystemDirectory</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span class="hs-identifier">getWindowsDirectory</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-220"></span><span class="hs-identifier">getWindowsDirectory</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;GetWindowsDirectory&quot;</span><span> </span><span class="hs-identifier">c_getWindowsDirectory</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="hs-identifier">getCurrentDirectory</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-223"></span><span class="hs-identifier">getCurrentDirectory</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;GetCurrentDirectory&quot;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">flip</span><span> </span><span class="hs-identifier">c_getCurrentDirectory</span><span class="hs-special">)</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span class="hs-identifier">getTemporaryDirectory</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-226"></span><span class="hs-identifier">getTemporaryDirectory</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;GetTempPath&quot;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">flip</span><span> </span><span class="hs-identifier">c_getTempPath</span><span class="hs-special">)</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-identifier">getFullPathName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">FilePath</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">FilePath</span><span>
</span><span id="line-229"></span><span class="hs-identifier">getFullPathName</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-230"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-231"></span><span>    </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;getFullPathName&quot;</span><span>
</span><span id="line-232"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">c_GetFullPathName</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">nullPtr</span><span class="hs-special">)</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="hs-identifier">getLongPathName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">FilePath</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">FilePath</span><span>
</span><span id="line-235"></span><span class="hs-identifier">getLongPathName</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-237"></span><span>    </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;getLongPathName&quot;</span><span>
</span><span id="line-238"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">c_GetLongPathName</span><span> </span><span class="hs-identifier">c_name</span><span class="hs-special">)</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span class="hs-identifier">getShortPathName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">FilePath</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">FilePath</span><span>
</span><span id="line-241"></span><span class="hs-identifier">getShortPathName</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-242"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-243"></span><span>    </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;getShortPathName&quot;</span><span>
</span><span id="line-244"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">c_GetShortPathName</span><span> </span><span class="hs-identifier">c_name</span><span class="hs-special">)</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-245"></span><span>
</span><span id="line-246"></span><span class="hs-identifier">searchPath</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FilePath</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">FilePath</span><span class="hs-special">)</span><span>
</span><span id="line-247"></span><span class="hs-identifier">searchPath</span><span> </span><span class="hs-identifier">path</span><span> </span><span class="hs-identifier">filename</span><span> </span><span class="hs-identifier">ext</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-248"></span><span>  </span><span class="hs-identifier">maybe</span><span> </span><span class="hs-special">(</span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">nullPtr</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">path</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">p_path</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-249"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">filename</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">p_filename</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-250"></span><span>  </span><span class="hs-identifier">maybeWith</span><span> </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">ext</span><span>      </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">p_ext</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-251"></span><span>  </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">ppFilePart</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span>
</span><span id="line-252"></span><span>    </span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">try</span><span> </span><span class="hs-string">&quot;searchPath&quot;</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">c_SearchPath</span><span> </span><span class="hs-identifier">p_path</span><span> </span><span class="hs-identifier">p_filename</span><span> </span><span class="hs-identifier">p_ext</span><span>
</span><span id="line-253"></span><span>                          </span><span class="hs-identifier">len</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">ppFilePart</span><span class="hs-special">)</span><span> </span><span class="hs-number">512</span><span>
</span><span id="line-254"></span><span>    </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Just</span><span> </span><span class="hs-identifier">s</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-255"></span><span>     </span><span class="hs-special">`</span><span class="hs-identifier">catch</span><span class="hs-special">`</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">e</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">isDoesNotExistError</span><span> </span><span class="hs-identifier">e</span><span>
</span><span id="line-256"></span><span>                       </span><span class="hs-keyword">then</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-identifier">Nothing</span><span>
</span><span id="line-257"></span><span>                       </span><span class="hs-keyword">else</span><span> </span><span class="hs-identifier">ioError</span><span> </span><span class="hs-identifier">e</span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;GetWindowsDirectoryW&quot;</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-identifier">c_getWindowsDirectory</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">UINT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;GetSystemDirectoryW&quot;</span><span>
</span><span id="line-263"></span><span>  </span><span class="hs-identifier">c_getSystemDirectory</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">UINT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;GetCurrentDirectoryW&quot;</span><span>
</span><span id="line-266"></span><span>  </span><span class="hs-identifier">c_getCurrentDirectory</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;GetTempPathW&quot;</span><span>
</span><span id="line-269"></span><span>  </span><span class="hs-identifier">c_getTempPath</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;GetFullPathNameW&quot;</span><span>
</span><span id="line-272"></span><span>  </span><span class="hs-identifier">c_GetFullPathName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;GetLongPathNameW&quot;</span><span>
</span><span id="line-275"></span><span>  </span><span class="hs-identifier">c_GetLongPathName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;GetShortPathNameW&quot;</span><span>
</span><span id="line-278"></span><span>  </span><span class="hs-identifier">c_GetShortPathName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;SearchPathW&quot;</span><span>
</span><span id="line-281"></span><span>  </span><span class="hs-identifier">c_SearchPath</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">LPTSTR</span><span>
</span><span id="line-282"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-285"></span><span class="hs-comment">-- System Info (Info about processor and memory subsystem)</span><span>
</span><span id="line-286"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-287"></span><span>
</span><span id="line-288"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">ProcessorArchitecture</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">PaUnknown</span><span> </span><span class="hs-identifier">WORD</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PaIntel</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PaMips</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PaAlpha</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PaPpc</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PaIa64</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PaIa32OnIa64</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PaAmd64</span><span>
</span><span id="line-289"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Show</span><span class="hs-special">,</span><span class="hs-identifier">Eq</span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Storable</span><span> </span><span class="hs-identifier">ProcessorArchitecture</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-292"></span><span>    </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">undefined</span><span class="hs-glyph">::</span><span class="hs-identifier">WORD</span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>    </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">undefined</span><span class="hs-glyph">::</span><span class="hs-identifier">WORD</span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">pa</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">pa</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-295"></span><span>        </span><span class="hs-identifier">PaUnknown</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">w</span><span>
</span><span id="line-296"></span><span>        </span><span class="hs-identifier">PaIntel</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-297"></span><span class="hs-pragma">{-# LINE 297 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-297"></span><span>        </span><span class="hs-identifier">PaMips</span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-number">1</span><span>
</span><span id="line-298"></span><span class="hs-pragma">{-# LINE 298 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-298"></span><span>        </span><span class="hs-identifier">PaAlpha</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-number">2</span><span>
</span><span id="line-299"></span><span class="hs-pragma">{-# LINE 299 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-299"></span><span>        </span><span class="hs-identifier">PaPpc</span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-number">3</span><span>
</span><span id="line-300"></span><span class="hs-pragma">{-# LINE 300 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-300"></span><span>        </span><span class="hs-identifier">PaIa64</span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-number">6</span><span>
</span><span id="line-301"></span><span class="hs-pragma">{-# LINE 301 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span class="hs-pragma">{-# LINE 302 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-302"></span><span>        </span><span class="hs-identifier">PaIa32OnIa64</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-number">10</span><span>
</span><span id="line-303"></span><span class="hs-pragma">{-# LINE 303 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-pragma">{-# LINE 304 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-304"></span><span>        </span><span class="hs-identifier">PaAmd64</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-number">9</span><span>
</span><span id="line-305"></span><span class="hs-pragma">{-# LINE 305 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-305"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-306"></span><span>        </span><span class="hs-identifier">v</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-number">0</span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">WORD</span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span>        </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">v</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-308"></span><span>            </span><span class="hs-special">(</span><span class="hs-number">0</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaIntel</span><span>
</span><span id="line-309"></span><span class="hs-pragma">{-# LINE 309 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-309"></span><span>            </span><span class="hs-special">(</span><span class="hs-number">1</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaMips</span><span>
</span><span id="line-310"></span><span class="hs-pragma">{-# LINE 310 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-310"></span><span>            </span><span class="hs-special">(</span><span class="hs-number">2</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaAlpha</span><span>
</span><span id="line-311"></span><span class="hs-pragma">{-# LINE 311 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-311"></span><span>            </span><span class="hs-special">(</span><span class="hs-number">3</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaPpc</span><span>
</span><span id="line-312"></span><span class="hs-pragma">{-# LINE 312 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-312"></span><span>            </span><span class="hs-special">(</span><span class="hs-number">6</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaIa64</span><span>
</span><span id="line-313"></span><span class="hs-pragma">{-# LINE 313 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-313"></span><span>
</span><span id="line-314"></span><span class="hs-pragma">{-# LINE 314 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-314"></span><span>            </span><span class="hs-special">(</span><span class="hs-number">10</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaIa32OnIa64</span><span>
</span><span id="line-315"></span><span class="hs-pragma">{-# LINE 315 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span class="hs-pragma">{-# LINE 316 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-316"></span><span>            </span><span class="hs-special">(</span><span class="hs-number">9</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaAmd64</span><span>
</span><span id="line-317"></span><span class="hs-pragma">{-# LINE 317 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-317"></span><span>            </span><span class="hs-identifier">w</span><span>                                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">PaUnknown</span><span> </span><span class="hs-identifier">w</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">SYSTEM_INFO</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">SYSTEM_INFO</span><span>
</span><span id="line-320"></span><span>    </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">siProcessorArchitecture</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ProcessorArchitecture</span><span>
</span><span id="line-321"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siPageSize</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-322"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siMinimumApplicationAddress</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siMaximumApplicationAddress</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPVOID</span><span>
</span><span id="line-323"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siActiveProcessorMask</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-324"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siNumberOfProcessors</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-325"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siProcessorType</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-326"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siAllocationGranularity</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-327"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siProcessorLevel</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WORD</span><span>
</span><span id="line-328"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">siProcessorRevision</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WORD</span><span>
</span><span id="line-329"></span><span>    </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Show</span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Storable</span><span> </span><span class="hs-identifier">SYSTEM_INFO</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-332"></span><span>    </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">const</span><span> </span><span class="hs-special">(</span><span class="hs-number">48</span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span class="hs-pragma">{-# LINE 333 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-333"></span><span>    </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">8</span><span>
</span><span id="line-334"></span><span class="hs-pragma">{-# LINE 334 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-334"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">si</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-335"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siProcessorArchitecture</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span class="hs-pragma">{-# LINE 336 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-336"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span>             </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siPageSize</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span class="hs-pragma">{-# LINE 337 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-337"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siMinimumApplicationAddress</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span class="hs-pragma">{-# LINE 338 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-338"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siMaximumApplicationAddress</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-339"></span><span class="hs-pragma">{-# LINE 339 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-339"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siActiveProcessorMask</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span class="hs-pragma">{-# LINE 340 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-340"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">32</span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siNumberOfProcessors</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span class="hs-pragma">{-# LINE 341 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-341"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">36</span><span class="hs-special">)</span><span class="hs-special">)</span><span>        </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siProcessorType</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-342"></span><span class="hs-pragma">{-# LINE 342 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-342"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">40</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siAllocationGranularity</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span class="hs-pragma">{-# LINE 343 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-343"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">44</span><span class="hs-special">)</span><span class="hs-special">)</span><span>        </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siProcessorLevel</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span class="hs-pragma">{-# LINE 344 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-344"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">46</span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">siProcessorRevision</span><span> </span><span class="hs-identifier">si</span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span class="hs-pragma">{-# LINE 345 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-345"></span><span>
</span><span id="line-346"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-347"></span><span>        </span><span class="hs-identifier">processorArchitecture</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-348"></span><span>            </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-349"></span><span class="hs-pragma">{-# LINE 349 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-349"></span><span>        </span><span class="hs-identifier">pageSize</span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-350"></span><span class="hs-pragma">{-# LINE 350 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-350"></span><span>        </span><span class="hs-identifier">minimumApplicationAddress</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-351"></span><span>            </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-352"></span><span class="hs-pragma">{-# LINE 352 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-352"></span><span>        </span><span class="hs-identifier">maximumApplicationAddress</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-353"></span><span>            </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-354"></span><span class="hs-pragma">{-# LINE 354 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-354"></span><span>        </span><span class="hs-identifier">activeProcessorMask</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-355"></span><span class="hs-pragma">{-# LINE 355 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-355"></span><span>        </span><span class="hs-identifier">numberOfProcessors</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">32</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-356"></span><span class="hs-pragma">{-# LINE 356 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-356"></span><span>        </span><span class="hs-identifier">processorType</span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">36</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-357"></span><span class="hs-pragma">{-# LINE 357 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-357"></span><span>        </span><span class="hs-identifier">allocationGranularity</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-358"></span><span>            </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">40</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-359"></span><span class="hs-pragma">{-# LINE 359 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-359"></span><span>        </span><span class="hs-identifier">processorLevel</span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">44</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-360"></span><span class="hs-pragma">{-# LINE 360 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-360"></span><span>        </span><span class="hs-identifier">processorRevision</span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">46</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-361"></span><span class="hs-pragma">{-# LINE 361 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-361"></span><span>        </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">SYSTEM_INFO</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-362"></span><span>            </span><span class="hs-identifier">siProcessorArchitecture</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">processorArchitecture</span><span class="hs-special">,</span><span>
</span><span id="line-363"></span><span>            </span><span class="hs-identifier">siPageSize</span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">pageSize</span><span class="hs-special">,</span><span>
</span><span id="line-364"></span><span>            </span><span class="hs-identifier">siMinimumApplicationAddress</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">minimumApplicationAddress</span><span class="hs-special">,</span><span>
</span><span id="line-365"></span><span>            </span><span class="hs-identifier">siMaximumApplicationAddress</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">maximumApplicationAddress</span><span class="hs-special">,</span><span>
</span><span id="line-366"></span><span>            </span><span class="hs-identifier">siActiveProcessorMask</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">activeProcessorMask</span><span class="hs-special">,</span><span>
</span><span id="line-367"></span><span>            </span><span class="hs-identifier">siNumberOfProcessors</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">numberOfProcessors</span><span class="hs-special">,</span><span>
</span><span id="line-368"></span><span>            </span><span class="hs-identifier">siProcessorType</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">processorType</span><span class="hs-special">,</span><span>
</span><span id="line-369"></span><span>            </span><span class="hs-identifier">siAllocationGranularity</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">allocationGranularity</span><span class="hs-special">,</span><span>
</span><span id="line-370"></span><span>            </span><span class="hs-identifier">siProcessorLevel</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">processorLevel</span><span class="hs-special">,</span><span>
</span><span id="line-371"></span><span>            </span><span class="hs-identifier">siProcessorRevision</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">processorRevision</span><span>
</span><span id="line-372"></span><span>            </span><span class="hs-special">}</span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetSystemInfo&quot;</span><span>
</span><span id="line-375"></span><span>    </span><span class="hs-identifier">c_GetSystemInfo</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEM_INFO</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="hs-identifier">getSystemInfo</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">SYSTEM_INFO</span><span>
</span><span id="line-378"></span><span class="hs-identifier">getSystemInfo</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">ret</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-379"></span><span>    </span><span class="hs-identifier">c_GetSystemInfo</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-380"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-381"></span><span>
</span><span id="line-382"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-383"></span><span class="hs-comment">-- System metrics</span><span>
</span><span id="line-384"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">SMSetting</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-387"></span><span>
</span><span id="line-388"></span><span class="hs-identifier">sM_ARRANGE</span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-389"></span><span class="hs-identifier">sM_ARRANGE</span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">56</span><span>
</span><span id="line-390"></span><span class="hs-identifier">sM_CLEANBOOT</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-391"></span><span class="hs-identifier">sM_CLEANBOOT</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">67</span><span>
</span><span id="line-392"></span><span class="hs-identifier">sM_CMETRICS</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-393"></span><span class="hs-identifier">sM_CMETRICS</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">97</span><span>
</span><span id="line-394"></span><span class="hs-identifier">sM_CMOUSEBUTTONS</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-395"></span><span class="hs-identifier">sM_CMOUSEBUTTONS</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">43</span><span>
</span><span id="line-396"></span><span class="hs-identifier">sM_CXBORDER</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-397"></span><span class="hs-identifier">sM_CXBORDER</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">5</span><span>
</span><span id="line-398"></span><span class="hs-identifier">sM_CYBORDER</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-399"></span><span class="hs-identifier">sM_CYBORDER</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">6</span><span>
</span><span id="line-400"></span><span class="hs-identifier">sM_CXCURSOR</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-401"></span><span class="hs-identifier">sM_CXCURSOR</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">13</span><span>
</span><span id="line-402"></span><span class="hs-identifier">sM_CYCURSOR</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-403"></span><span class="hs-identifier">sM_CYCURSOR</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">14</span><span>
</span><span id="line-404"></span><span class="hs-identifier">sM_CXDLGFRAME</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-405"></span><span class="hs-identifier">sM_CXDLGFRAME</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">7</span><span>
</span><span id="line-406"></span><span class="hs-identifier">sM_CYDLGFRAME</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-407"></span><span class="hs-identifier">sM_CYDLGFRAME</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">8</span><span>
</span><span id="line-408"></span><span class="hs-identifier">sM_CXDOUBLECLK</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-409"></span><span class="hs-identifier">sM_CXDOUBLECLK</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">36</span><span>
</span><span id="line-410"></span><span class="hs-identifier">sM_CYDOUBLECLK</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-411"></span><span class="hs-identifier">sM_CYDOUBLECLK</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">37</span><span>
</span><span id="line-412"></span><span class="hs-identifier">sM_CXDRAG</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-413"></span><span class="hs-identifier">sM_CXDRAG</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">68</span><span>
</span><span id="line-414"></span><span class="hs-identifier">sM_CYDRAG</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-415"></span><span class="hs-identifier">sM_CYDRAG</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">69</span><span>
</span><span id="line-416"></span><span class="hs-identifier">sM_CXEDGE</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-417"></span><span class="hs-identifier">sM_CXEDGE</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">45</span><span>
</span><span id="line-418"></span><span class="hs-identifier">sM_CYEDGE</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-419"></span><span class="hs-identifier">sM_CYEDGE</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">46</span><span>
</span><span id="line-420"></span><span class="hs-identifier">sM_CXFRAME</span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-421"></span><span class="hs-identifier">sM_CXFRAME</span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">32</span><span>
</span><span id="line-422"></span><span class="hs-identifier">sM_CYFRAME</span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-423"></span><span class="hs-identifier">sM_CYFRAME</span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">33</span><span>
</span><span id="line-424"></span><span class="hs-identifier">sM_CXFULLSCREEN</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-425"></span><span class="hs-identifier">sM_CXFULLSCREEN</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">16</span><span>
</span><span id="line-426"></span><span class="hs-identifier">sM_CYFULLSCREEN</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-427"></span><span class="hs-identifier">sM_CYFULLSCREEN</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">17</span><span>
</span><span id="line-428"></span><span class="hs-identifier">sM_CXHSCROLL</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-429"></span><span class="hs-identifier">sM_CXHSCROLL</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">21</span><span>
</span><span id="line-430"></span><span class="hs-identifier">sM_CYVSCROLL</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-431"></span><span class="hs-identifier">sM_CYVSCROLL</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">20</span><span>
</span><span id="line-432"></span><span class="hs-identifier">sM_CXICON</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-433"></span><span class="hs-identifier">sM_CXICON</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">11</span><span>
</span><span id="line-434"></span><span class="hs-identifier">sM_CYICON</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-435"></span><span class="hs-identifier">sM_CYICON</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">12</span><span>
</span><span id="line-436"></span><span class="hs-identifier">sM_CXICONSPACING</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-437"></span><span class="hs-identifier">sM_CXICONSPACING</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">38</span><span>
</span><span id="line-438"></span><span class="hs-identifier">sM_CYICONSPACING</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-439"></span><span class="hs-identifier">sM_CYICONSPACING</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">39</span><span>
</span><span id="line-440"></span><span class="hs-identifier">sM_CXMAXIMIZED</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-441"></span><span class="hs-identifier">sM_CXMAXIMIZED</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">61</span><span>
</span><span id="line-442"></span><span class="hs-identifier">sM_CYMAXIMIZED</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-443"></span><span class="hs-identifier">sM_CYMAXIMIZED</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">62</span><span>
</span><span id="line-444"></span><span class="hs-identifier">sM_CXMENUCHECK</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-445"></span><span class="hs-identifier">sM_CXMENUCHECK</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">71</span><span>
</span><span id="line-446"></span><span class="hs-identifier">sM_CYMENUCHECK</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-447"></span><span class="hs-identifier">sM_CYMENUCHECK</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">72</span><span>
</span><span id="line-448"></span><span class="hs-identifier">sM_CXMENUSIZE</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-449"></span><span class="hs-identifier">sM_CXMENUSIZE</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">54</span><span>
</span><span id="line-450"></span><span class="hs-identifier">sM_CYMENUSIZE</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-451"></span><span class="hs-identifier">sM_CYMENUSIZE</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">55</span><span>
</span><span id="line-452"></span><span class="hs-identifier">sM_CXMIN</span><span>              </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-453"></span><span class="hs-identifier">sM_CXMIN</span><span>              </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">28</span><span>
</span><span id="line-454"></span><span class="hs-identifier">sM_CYMIN</span><span>              </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-455"></span><span class="hs-identifier">sM_CYMIN</span><span>              </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">29</span><span>
</span><span id="line-456"></span><span class="hs-identifier">sM_CXMINIMIZED</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-457"></span><span class="hs-identifier">sM_CXMINIMIZED</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">57</span><span>
</span><span id="line-458"></span><span class="hs-identifier">sM_CYMINIMIZED</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-459"></span><span class="hs-identifier">sM_CYMINIMIZED</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">58</span><span>
</span><span id="line-460"></span><span class="hs-identifier">sM_CXMINTRACK</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-461"></span><span class="hs-identifier">sM_CXMINTRACK</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">34</span><span>
</span><span id="line-462"></span><span class="hs-identifier">sM_CYMINTRACK</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-463"></span><span class="hs-identifier">sM_CYMINTRACK</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">35</span><span>
</span><span id="line-464"></span><span class="hs-identifier">sM_CXSCREEN</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-465"></span><span class="hs-identifier">sM_CXSCREEN</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">0</span><span>
</span><span id="line-466"></span><span class="hs-identifier">sM_CYSCREEN</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-467"></span><span class="hs-identifier">sM_CYSCREEN</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1</span><span>
</span><span id="line-468"></span><span class="hs-identifier">sM_CXSIZE</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-469"></span><span class="hs-identifier">sM_CXSIZE</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">30</span><span>
</span><span id="line-470"></span><span class="hs-identifier">sM_CYSIZE</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-471"></span><span class="hs-identifier">sM_CYSIZE</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">31</span><span>
</span><span id="line-472"></span><span class="hs-identifier">sM_CXSIZEFRAME</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-473"></span><span class="hs-identifier">sM_CXSIZEFRAME</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">32</span><span>
</span><span id="line-474"></span><span class="hs-identifier">sM_CYSIZEFRAME</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-475"></span><span class="hs-identifier">sM_CYSIZEFRAME</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">33</span><span>
</span><span id="line-476"></span><span class="hs-identifier">sM_CXSMICON</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-477"></span><span class="hs-identifier">sM_CXSMICON</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">49</span><span>
</span><span id="line-478"></span><span class="hs-identifier">sM_CYSMICON</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-479"></span><span class="hs-identifier">sM_CYSMICON</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">50</span><span>
</span><span id="line-480"></span><span class="hs-identifier">sM_CXSMSIZE</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-481"></span><span class="hs-identifier">sM_CXSMSIZE</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">52</span><span>
</span><span id="line-482"></span><span class="hs-identifier">sM_CYSMSIZE</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-483"></span><span class="hs-identifier">sM_CYSMSIZE</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">53</span><span>
</span><span id="line-484"></span><span class="hs-identifier">sM_CXVSCROLL</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-485"></span><span class="hs-identifier">sM_CXVSCROLL</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">2</span><span>
</span><span id="line-486"></span><span class="hs-identifier">sM_CYHSCROLL</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-487"></span><span class="hs-identifier">sM_CYHSCROLL</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">3</span><span>
</span><span id="line-488"></span><span class="hs-identifier">sM_CYVTHUMB</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-489"></span><span class="hs-identifier">sM_CYVTHUMB</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">9</span><span>
</span><span id="line-490"></span><span class="hs-identifier">sM_CYCAPTION</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-491"></span><span class="hs-identifier">sM_CYCAPTION</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">4</span><span>
</span><span id="line-492"></span><span class="hs-identifier">sM_CYKANJIWINDOW</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-493"></span><span class="hs-identifier">sM_CYKANJIWINDOW</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">18</span><span>
</span><span id="line-494"></span><span class="hs-identifier">sM_CYMENU</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-495"></span><span class="hs-identifier">sM_CYMENU</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">15</span><span>
</span><span id="line-496"></span><span class="hs-identifier">sM_CYSMCAPTION</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-497"></span><span class="hs-identifier">sM_CYSMCAPTION</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">51</span><span>
</span><span id="line-498"></span><span class="hs-identifier">sM_DBCSENABLED</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-499"></span><span class="hs-identifier">sM_DBCSENABLED</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">42</span><span>
</span><span id="line-500"></span><span class="hs-identifier">sM_DEBUG</span><span>              </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-501"></span><span class="hs-identifier">sM_DEBUG</span><span>              </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">22</span><span>
</span><span id="line-502"></span><span class="hs-identifier">sM_MENUDROPALIGNMENT</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-503"></span><span class="hs-identifier">sM_MENUDROPALIGNMENT</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">40</span><span>
</span><span id="line-504"></span><span class="hs-identifier">sM_MIDEASTENABLED</span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-505"></span><span class="hs-identifier">sM_MIDEASTENABLED</span><span>     </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">74</span><span>
</span><span id="line-506"></span><span class="hs-identifier">sM_MOUSEPRESENT</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-507"></span><span class="hs-identifier">sM_MOUSEPRESENT</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">19</span><span>
</span><span id="line-508"></span><span class="hs-identifier">sM_NETWORK</span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-509"></span><span class="hs-identifier">sM_NETWORK</span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">63</span><span>
</span><span id="line-510"></span><span class="hs-identifier">sM_PENWINDOWS</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-511"></span><span class="hs-identifier">sM_PENWINDOWS</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">41</span><span>
</span><span id="line-512"></span><span class="hs-identifier">sM_SECURE</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-513"></span><span class="hs-identifier">sM_SECURE</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">44</span><span>
</span><span id="line-514"></span><span class="hs-identifier">sM_SHOWSOUNDS</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-515"></span><span class="hs-identifier">sM_SHOWSOUNDS</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">70</span><span>
</span><span id="line-516"></span><span class="hs-identifier">sM_SLOWMACHINE</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-517"></span><span class="hs-identifier">sM_SLOWMACHINE</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">73</span><span>
</span><span id="line-518"></span><span class="hs-identifier">sM_SWAPBUTTON</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SMSetting</span><span>
</span><span id="line-519"></span><span class="hs-identifier">sM_SWAPBUTTON</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">23</span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="hs-pragma">{-# LINE 456 &quot;libraries\\Win32\\System\\Win32\\Info.hsc&quot; #-}</span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span class="hs-comment">-- %fun GetSystemMetrics :: SMSetting -&gt; IO Int</span><span>
</span><span id="line-458"></span><span>
</span><span id="line-459"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-460"></span><span class="hs-comment">-- Thread Desktops</span><span>
</span><span id="line-461"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span class="hs-comment">-- %fun GetThreadDesktop :: ThreadId -&gt; IO HDESK</span><span>
</span><span id="line-464"></span><span class="hs-comment">-- %fun SetThreadDesktop :: ThreadId -&gt; HDESK -&gt; IO ()</span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-467"></span><span class="hs-comment">-- User name</span><span>
</span><span id="line-468"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span class="hs-comment">-- %fun GetUserName :: IO String</span><span>
</span><span id="line-471"></span><span>
</span><span id="line-472"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetUserNameW&quot;</span><span>
</span><span id="line-473"></span><span>  </span><span class="hs-identifier">c_GetUserName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPDWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-474"></span><span>
</span><span id="line-475"></span><span class="hs-identifier">getUserName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-476"></span><span class="hs-identifier">getUserName</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-477"></span><span>  </span><span class="hs-identifier">allocaArray</span><span> </span><span class="hs-number">512</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_str</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-478"></span><span>    </span><span class="hs-identifier">with</span><span> </span><span class="hs-number">512</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_len</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-479"></span><span>        </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;GetUserName&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetUserName</span><span> </span><span class="hs-identifier">c_str</span><span> </span><span class="hs-identifier">c_len</span><span>
</span><span id="line-480"></span><span>        </span><span class="hs-identifier">len</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">c_len</span><span>
</span><span id="line-481"></span><span>        </span><span class="hs-identifier">peekTStringLen</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">c_str</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-glyph">-</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span>
</span><span id="line-482"></span><span>
</span><span id="line-483"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-484"></span><span class="hs-comment">-- End</span><span>
</span><span id="line-485"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-486"></span></pre></body></html>